//
//  UIlabel+extension.m
//  王雷Sinoweibo
//
//  Created by wanglei on 16/10/28.
//  Copyright © 2016年 wanglei. All rights reserved.
//

#import "UIlabel+extension.h"



@implementation UIlabel_extension

+(UILabel *)factoryLabel:(NSString *)text fontsize:(CGFloat)fontsize textColor:(UIColor *)textcolor;{
    
    UILabel *label = [[UILabel alloc]init];
    
    label.text = text;
    label.font = [UIFont systemFontOfSize:fontsize];
    label.textColor = textcolor;
    label.numberOfLines = 0;
    label.textAlignment = NSTextAlignmentCenter;
    [label sizeToFit];
    
    return label;
    
}

- (id)initWithtext:(NSString *)text fontsize:(CGFloat)fontsize textColor:(UIColor *)textcolor;{
    
    self = [super init];
    if(self){
        
        [self setText:text];
        [self setFont:[UIFont systemFontOfSize:fontsize]];
        [self setTextColor:textcolor];
        self.numberOfLines = 0;
        self.textAlignment = NSTextAlignmentCenter;

    [self sizeToFit];
    
    }
    return self;
}


//一定注意遍历构造函数的写法是initWith.....,其中那个With一定是W,不能是w

- (id)initWithdrawTextInRect:(CGRect)rect;{
    
    self = [super init];
    if (self) {
        [self drawTextInRect:rect];
    }
    
    return self;
    
}
@end
